import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import SystemAdmin from "../views/router/SystemAdmin.vue";
import DormitoryAdminAdd from "../views/dormitory_admin/DormitoryAdminAdd.vue";
import DormitoryAdminManager from "../views/dormitory_admin/DormitoryAdminManager.vue";
import DormitoryAdminUpdate from "../views/dormitory_admin/DormitoryAdminUpdate.vue";
import StudentAdd from "../views/student/StudentAdd.vue";
import StudentManager from "../views/student/StudentManager.vue";
import StudentUpdate from "../views/student/StudentUpdate.vue";
import BuildingAdd from "../views/building/BuildingAdd.vue";
import BuildingManager from "../views/building/BuildingManager.vue";
import BuildingUpdate from "../views/building/BuildingUpdate.vue";
import DormitoryAdd from "../views/dormitory/DormitoryAdd.vue";
import DormitoryManager from "../views/dormitory/DormitoryManager.vue";
import DormitoryUpdate from "../views/dormitory/DormitoryUpdate.vue";
import MoveoutRegister from "../views/moveout/MoveoutRegister.vue";
import MoveRecord from "../views/moveout/MoveRecord.vue";
import AbsentRecord from "../views/absent/AbsentRecord.vue";
import DormitoryAdmin from "../views/router/DormitoryAdmin.vue";
import AbsentRegister from "../views/absent/AbsentRegister.vue";
import Home from "../views/home/Home.vue";
import DormitoryHome from "../views/home/DormitoryHome.vue";
import DormitoryAllocation from "../views/allocation/DormitoryAllocation.vue";
import MaintenanceManagement from "../views/maintenance/MaintenanceManagement.vue";
import UtilitiesManagement from "../views/utility/UtilitiesManagement.vue";
import NoticesManager from "../views/notice/NoticesManager.vue";
import NoticesAdd from "../views/notice/NoticesManager.vue";
import DormitoryAllocationResult from "../views/allocation/DormitoryAllocationResult.vue";
import About from "../views/About";
import StudentHome from "../views/home/StudentHome.vue";
import StudentPersonalInformation from "../views/student/StudentPersonalInformation";
import StudentLeave from "../views/leave/StudentLeave.vue";
import MaintenanceApplication from "../views/maintenance/MaintenanceApplication.vue";
import UtilityBill from "../views/utility/UtilityBill.vue";
import Student from "../views/router/Student.vue";
import StudentLeaveDetails from "../views/leave/StudentLeaveDetails.vue";
import MaintenanceDetails from "../views/maintenance/MaintenanceDetails.vue";
import UtilitiesUpdate from "@/views/utility/UtilitiesUpdate.vue";
import MaintenanceUpdate from "@/views/maintenance/MaintenanceUpdate.vue";
import StudentAddByDA from "@/views/student/StudentAddByDA.vue";

import StudentManagerByDA from "@/views/student/StudentManagerByDA.vue";

import StudentUpdateByDA from "@/views/student/StudentUpdateByDA.vue";
import MaintenanceManagementByDA from "@/views/maintenance/MaintenanceManagementByDA.vue";
import MaintenanceUpdateByDA from "@/views/maintenance/MaintenanceUpdateByDA.vue";
import DormitoryUpdateByDA from "@/views/dormitory/DormitoryUpdateByDA.vue";
import DormitoryManagerByDA from "@/views/dormitory/DormitoryManagerByDA.vue";
import DormitoryAddByDA from "@/views/dormitory/DormitoryAddByDA.vue";


Vue.use(VueRouter)

// 路由规则
const routes = [
    {
        path: '/dormitoryAdmin',
        name: '公寓管理员',
        component: DormitoryAdmin,
        redirect: '/dormitoryHome',
        children: [
            {
                path: '/dormitoryHome',
                name: '首页-公寓管理员',
                component: DormitoryHome
            },
            {
                path: '/studentAddByDA',
                name: '添加学生-公寓管理员',
                component: StudentAddByDA
            },
            {
                path: '/studentManagerByDA',
                name: '学生管理-公寓管理员',
                component: StudentManagerByDA
            },
            {
                path: '/studentUpdateByDA',
                name: '修改学生-公寓管理员',
                component: StudentUpdateByDA
            },
            {
                path: '/dormitoryAddByDA',
                name: '添加公寓-公寓管理员',
                component: DormitoryAddByDA
            },
            {
                path: '/dormitoryManagerByDA',
                name: '公寓管理-公寓管理员',
                component: DormitoryManagerByDA
            },
            {
                path: '/dormitoryUpdateByDA',
                name: '修改公寓-公寓管理员',
                component: DormitoryUpdateByDA
            },
            {
                path: '/absentRecord2',
                name: '缺寝记录-公寓管理员',
                component: AbsentRecord
            },
            {
                path: '/absentRegister',
                name: '缺寝登记',
                component: AbsentRegister
            },
            {
                path: '/maintenanceManagementByDA',
                name: '维修管理-公寓管理员',
                component: MaintenanceManagementByDA
            },
            {
                path: '/maintenanceUpdateByDA',
                name: '维修更新-公寓管理员',
                component: MaintenanceUpdateByDA
            },
            {
                path: '/About2',
                name: '关于-公寓管理员',
                component: About
            },
        ]
    },

    {
        path: '/student',
        name: '学生',
        component: Student,
        redirect: '/studentHome',
        children: [
            {
                path: '/studentHome',
                name: '首页-学生',
                component: StudentHome
            },
            {
                path: '/studentPersonalInformation',
                name: '个人信息管理',
                component: StudentPersonalInformation
            },
            {
                path: '/studentLeave',
                name: '学生请假',
                component: StudentLeave
            },
            {
                path: '/leaveDetails', // 新增请假详情页面
                name: '请假详情',
                component: StudentLeaveDetails
            },
            {
                path: '/maintenanceApplication',
                name: '维修申请',
                component: MaintenanceApplication
            },
            {
                path: '/maintenanceDetails', // 新增维修详情页面
                name: '维修详情',
                component: MaintenanceDetails
            },
            {
                path: '/utilityBill',
                name: '水电费查看',
                component: UtilityBill
            },
            {
                path: '/About3',
                name: '关于-学生',
                component: About
            },
        ]
    },
    {
        path: '/systemAdmin',
        name: '系统管理员',
        component: SystemAdmin,
        redirect: '/home',
        children: [
            {
                path: '/home',
                name: '首页',
                component: Home
            },
            {
                path: '/dormitoryAdminManager',
                name: '宿管管理',
                component: DormitoryAdminManager
            },
            {
                path: '/dormitoryAdminAdd',
                name: '添加宿管',
                component: DormitoryAdminAdd
            },
            {
                path: '/dormitoryAdminUpdate',
                name: '修改宿管',
                component: DormitoryAdminUpdate
            },
            {
                path: '/studentAdd',
                name: '添加学生',
                component: StudentAdd
            },
            {
                path: '/studentManager',
                name: '学生管理',
                component: StudentManager
            },
            {
                path: '/studentUpdate',
                name: '修改学生',
                component: StudentUpdate
            },
            {
                path: '/buildingAdd',
                name: '添加楼栋',
                component: BuildingAdd
            },
            {
                path: '/buildingManager',
                name: '楼栋管理',
                component: BuildingManager
            },
            {
                path: '/buildingUpdate',
                name: '修改楼栋',
                component: BuildingUpdate
            },
            {
                path: '/dormitoryAdd',
                name: '添加公寓',
                component: DormitoryAdd
            },
            {
                path: '/dormitoryManager',
                name: '公寓管理',
                component: DormitoryManager
            },
            {
                path: '/dormitoryUpdate',
                name: '修改公寓',
                component: DormitoryUpdate
            },
            {
                path: '/moveoutRegister',
                name: '迁出登记',
                component: MoveoutRegister
            },
            {
                path: '/moveoutRecord',
                name: '迁出记录',
                component: MoveRecord
            },
            {
                path: '/absentRecord',
                name: '缺寝记录',
                component: AbsentRecord
            },
            {
                path: '/dormitoryAllocation',
                name: '公寓分配管理',
                component: DormitoryAllocation
            },
            {
                path: '/dormitoryAllocationResult',
                name: '公寓分配结果',
                component: DormitoryAllocationResult
            },
            {
                path: '/maintenanceManagement',
                name: '维修管理',
                component: MaintenanceManagement
            },
            {
                path: '/maintenanceUpdate',
                name: '维修更新',
                component: MaintenanceUpdate
            },
            {
                path: '/utilitiesManagement',
                name: '水电费管理',
                component: UtilitiesManagement
            },
            {
                path: '/UtilitiesUpdate',
                name: '水电费更新',
                component: UtilitiesUpdate
            },
            {
                path: '/NoticesManager',
                name: '公告栏管理',
                component: NoticesManager
            },

            {
                path: '/About1',
                name: '关于-超级管理员',
                component: About
            },


        ]
    },
    {
        path: '/login',
        name: '登录',
        component: Login
    },
    {
        path: '/',
        name: '登录2',
        component: Login
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
